Horizontal Pod Autoscaler (HPA)

HPA는 CPU 사용률이나 기타 선택된 메트릭에 따라 워크로드 리소스(Deployment, StatefulSet 등)의 Pod 수를 자동으로 조정합니다.

특징

실습 예시

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: webapp-hpa
  namespace: default
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: kkapp-deploy
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50
  behavior:
    scaleDown:
      stabilizationWindowSeconds: 300

주요 필드 설명